core: Fix g_file_get_uri/get_parse_name for non-root ostree files
authorJames Antill <james@and.org>
Wed, 18 Jun 2014 06:57:19 +0000 (02:57 -0400)
committerColin Walters <walters@verbum.org>
Wed, 18 Jun 2014 21:34:04 +0000 (17:34 -0400)
src/libostree/ostree-repo-file.c

index 4985709930973503f615a0094c56b802272f927c..454b523ba56143e14dcf1ff977daeb66447dbb03 100644 (file)
@@ -495,12 +495,13 @@ ostree_repo_file_get_uri (GFile *file)
   const char *path;
   char *uri_path;
   char *ret;
+  OstreeRepoFile *root = ostree_repo_file_get_root (self);
 
   path = gs_file_get_path_cached (file);
   uri_path = g_filename_to_uri (path, NULL, NULL);
   g_assert (g_str_has_prefix (uri_path, "file://"));
   ret = g_strconcat ("ostree://",
-                     self->tree_contents_checksum, "/", self->tree_metadata_checksum,
+                     root->tree_contents_checksum, "/", root->tree_metadata_checksum,
                      uri_path+strlen("file://"),
                      NULL);
   g_free (uri_path);